Field of the Invention
The invention relates to a data storage device, and more particularly to a data storage device for detecting a programming operation.
Description of the Related Art
Flash memory is a common non-volatile data storage device, which can be erased and programmed electrically. For example, an NAND flash memory is usually for use in a memory card, a USB flash device, a solid-state disk (SSD), an embedded multimedia card, etc. In recent years, flash memories have been made to have the characteristics of data non-volatility, low power consumption, compact size, and non-mechanical structure. Hence, flash memories have been adapted for use in various electronic devices, especially portable electronic devices.
A flash memory comprises a plurality of blocks, and each block comprises a plurality of pages for data storage. When the flash memory receives a program (write) command from a controller, the flash memory writes data to pages of the blocks thereof according to instructions of the controller and the program address. When the flash memory receives a read command from the controller, the flash memory reads data from pages of the blocks thereof according to the instructions of the controller and the program address, and then issues read-out data back to the controller. However, if an unexpected situation occurs when the data is stored into the flash memory, the programming operation may result in failure. If the controller cannot instantly detect that the programming operation has failed, it may be because the read data is wrong.
Therefore, a detection method to determine whether a programming operation of a flash memory is normal is desirable.